using Google.ProtocolBuffers;
using Google.ProtocolBuffers.Collections;
using micromsg.Proto;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace micromsg
{
	[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
	public sealed class SnsTag : GeneratedMessageLite<SnsTag, SnsTag.Builder>
	{
		[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
		public sealed class Builder : GeneratedBuilderLite<SnsTag, SnsTag.Builder>
		{
			private bool resultIsReadOnly;
			private SnsTag result;
			protected override SnsTag.Builder ThisBuilder
			{
				get
				{
					return this;
				}
			}
			public override bool IsInitialized
			{
				get
				{
					return this.result.IsInitialized;
				}
			}
			protected override SnsTag MessageBeingBuilt
			{
				get
				{
					return this.PrepareBuilder();
				}
			}
			public override SnsTag DefaultInstanceForType
			{
				get
				{
					return SnsTag.DefaultInstance;
				}
			}
			public ulong TagId
			{
				get
				{
					return this.result.TagId;
				}
				set
				{
					this.SetTagId(value);
				}
			}
			public string TagName
			{
				get
				{
					return this.result.TagName;
				}
				set
				{
					this.SetTagName(value);
				}
			}
			public uint Count
			{
				get
				{
					return this.result.Count;
				}
				set
				{
					this.SetCount(value);
				}
			}
			public IPopsicleList<SKBuiltinString_t> ListList
			{
				get
				{
					return this.PrepareBuilder().list_;
				}
			}
			public int ListCount
			{
				get
				{
					return this.result.ListCount;
				}
			}
			public Builder()
			{
				this.result = SnsTag.DefaultInstance;
				this.resultIsReadOnly = true;
			}
			internal Builder(SnsTag cloneFrom)
			{
				this.result = cloneFrom;
				this.resultIsReadOnly = true;
			}
			private SnsTag PrepareBuilder()
			{
				if (this.resultIsReadOnly)
				{
					SnsTag other = this.result;
					this.result = new SnsTag();
					this.resultIsReadOnly = false;
					this.MergeFrom(other);
				}
				return this.result;
			}
			public override SnsTag.Builder Clear()
			{
				this.result = SnsTag.DefaultInstance;
				this.resultIsReadOnly = true;
				return this;
			}
			public override SnsTag.Builder Clone()
			{
				if (this.resultIsReadOnly)
				{
					return new SnsTag.Builder(this.result);
				}
				return new SnsTag.Builder().MergeFrom(this.result);
			}
			public override SnsTag BuildPartial()
			{
				if (this.resultIsReadOnly)
				{
					return this.result;
				}
				this.resultIsReadOnly = true;
				return this.result.MakeReadOnly();
			}
			public override SnsTag.Builder MergeFrom(IMessageLite other)
			{
				if (other is SnsTag)
				{
					return this.MergeFrom((SnsTag)other);
				}
				base.MergeFrom(other);
				return this;
			}
			public override SnsTag.Builder MergeFrom(SnsTag other)
			{
				return this;
			}
			public override SnsTag.Builder MergeFrom(ICodedInputStream input)
			{
				return this.MergeFrom(input, ExtensionRegistry.Empty);
			}
			public override SnsTag.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
			{
				this.PrepareBuilder();
				uint num;
				string text;
				while (input.ReadTag(out num, out text))
				{
					if (num == 0u && text != null)
					{
						int num2 = Array.BinarySearch<string>(SnsTag._snsTagFieldNames, text, StringComparer.get_Ordinal());
						if (num2 < 0)
						{
							this.ParseUnknownField(input, extensionRegistry, num, text);
							continue;
						}
						num = SnsTag._snsTagFieldTags[num2];
					}
					uint num3 = num;
					if (num3 <= 8u)
					{
						if (num3 == 0u)
						{
							throw InvalidProtocolBufferException.InvalidTag();
						}
						if (num3 == 8u)
						{
							this.result.hasTagId = input.ReadUInt64(ref this.result.tagId_);
							continue;
						}
					}
					else
					{
						if (num3 == 18u)
						{
							this.result.hasTagName = input.ReadString(ref this.result.tagName_);
							continue;
						}
						if (num3 == 24u)
						{
							this.result.hasCount = input.ReadUInt32(ref this.result.count_);
							continue;
						}
						if (num3 == 34u)
						{
							input.ReadMessageArray<SKBuiltinString_t>(num, text, this.result.list_, SKBuiltinString_t.DefaultInstance, extensionRegistry);
							continue;
						}
					}
					if (WireFormat.IsEndGroupTag(num))
					{
						return this;
					}
					this.ParseUnknownField(input, extensionRegistry, num, text);
				}
				return this;
			}
			public SnsTag.Builder SetTagId(ulong value)
			{
				this.PrepareBuilder();
				this.result.hasTagId = true;
				this.result.tagId_ = value;
				return this;
			}
			public SnsTag.Builder ClearTagId()
			{
				this.PrepareBuilder();
				this.result.hasTagId = false;
				this.result.tagId_ = 0uL;
				return this;
			}
			public SnsTag.Builder SetTagName(string value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasTagName = true;
				this.result.tagName_ = value;
				return this;
			}
			public SnsTag.Builder ClearTagName()
			{
				this.PrepareBuilder();
				this.result.hasTagName = false;
				this.result.tagName_ = "";
				return this;
			}
			public SnsTag.Builder SetCount(uint value)
			{
				this.PrepareBuilder();
				this.result.hasCount = true;
				this.result.count_ = value;
				return this;
			}
			public SnsTag.Builder ClearCount()
			{
				this.PrepareBuilder();
				this.result.hasCount = false;
				this.result.count_ = 0u;
				return this;
			}
			public SKBuiltinString_t GetList(int index)
			{
				return this.result.GetList(index);
			}
			public SnsTag.Builder SetList(int index, SKBuiltinString_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.list_[index] = value;
				return this;
			}
			public SnsTag.Builder SetList(int index, SKBuiltinString_t.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.list_[index] = builderForValue.Build();
				return this;
			}
			public SnsTag.Builder AddList(SKBuiltinString_t value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.list_.Add(value);
				return this;
			}
			public SnsTag.Builder AddList(SKBuiltinString_t.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.list_.Add(builderForValue.Build());
				return this;
			}
			public SnsTag.Builder AddRangeList(IEnumerable<SKBuiltinString_t> values)
			{
				this.PrepareBuilder();
				this.result.list_.Add(values);
				return this;
			}
			public SnsTag.Builder ClearList()
			{
				this.PrepareBuilder();
				this.result.list_.Clear();
				return this;
			}
		}
		public const int TagIdFieldNumber = 1;
		public const int TagNameFieldNumber = 2;
		public const int CountFieldNumber = 3;
		public const int ListFieldNumber = 4;
		private static readonly SnsTag defaultInstance;
		private static readonly string[] _snsTagFieldNames;
		private static readonly uint[] _snsTagFieldTags;
		private bool hasTagId;
		private ulong tagId_;
		private bool hasTagName;
		private string tagName_ = "";
		private bool hasCount;
		private uint count_;
		private PopsicleList<SKBuiltinString_t> list_ = new PopsicleList<SKBuiltinString_t>();
		private int memoizedSerializedSize = -1;
		public static SnsTag DefaultInstance
		{
			get
			{
				return SnsTag.defaultInstance;
			}
		}
		public override SnsTag DefaultInstanceForType
		{
			get
			{
				return SnsTag.DefaultInstance;
			}
		}
		protected override SnsTag ThisMessage
		{
			get
			{
				return this;
			}
		}
		public ulong TagId
		{
			get
			{
				return this.tagId_;
			}
		}
		public string TagName
		{
			get
			{
				return this.tagName_;
			}
		}
		public uint Count
		{
			get
			{
				return this.count_;
			}
		}
		public IList<SKBuiltinString_t> ListList
		{
			get
			{
				return this.list_;
			}
		}
		public int ListCount
		{
			get
			{
				return this.list_.Count;
			}
		}
		public override bool IsInitialized
		{
			get
			{
				return this.hasTagId && this.hasCount;
			}
		}
		public override int SerializedSize
		{
			get
			{
				int num = this.memoizedSerializedSize;
				if (num != -1)
				{
					return num;
				}
				num = 0;
				if (this.hasTagId)
				{
					num += CodedOutputStream.ComputeUInt64Size(1, this.TagId);
				}
				if (this.hasTagName)
				{
					num += CodedOutputStream.ComputeStringSize(2, this.TagName);
				}
				if (this.hasCount)
				{
					num += CodedOutputStream.ComputeUInt32Size(3, this.Count);
				}
				using (IEnumerator<SKBuiltinString_t> enumerator = this.ListList.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						SKBuiltinString_t current = enumerator.get_Current();
						num += CodedOutputStream.ComputeMessageSize(4, current);
					}
				}
				this.memoizedSerializedSize = num;
				return num;
			}
		}
		private SnsTag()
		{
		}
		public SKBuiltinString_t GetList(int index)
		{
			return this.list_[index];
		}
		public override void WriteTo(ICodedOutputStream output)
		{
			int arg_06_0 = this.SerializedSize;
			string[] snsTagFieldNames = SnsTag._snsTagFieldNames;
			if (this.hasTagId)
			{
				output.WriteUInt64(1, snsTagFieldNames[2], this.TagId);
			}
			if (this.hasTagName)
			{
				output.WriteString(2, snsTagFieldNames[3], this.TagName);
			}
			if (this.hasCount)
			{
				output.WriteUInt32(3, snsTagFieldNames[0], this.Count);
			}
			if (this.list_.Count > 0)
			{
				output.WriteMessageArray<SKBuiltinString_t>(4, snsTagFieldNames[1], this.list_);
			}
		}
		public override int GetHashCode()
		{
			int num = base.GetType().GetHashCode();
			if (this.hasTagId)
			{
				num ^= this.tagId_.GetHashCode();
			}
			if (this.hasTagName)
			{
				num ^= this.tagName_.GetHashCode();
			}
			if (this.hasCount)
			{
				num ^= this.count_.GetHashCode();
			}
			using (IEnumerator<SKBuiltinString_t> enumerator = this.list_.GetEnumerator())
			{
				while (enumerator.MoveNext())
				{
					SKBuiltinString_t current = enumerator.get_Current();
					num ^= current.GetHashCode();
				}
			}
			return num;
		}
		public override bool Equals(object object_0)
		{
			SnsTag snsTag = object_0 as SnsTag;
			if (snsTag == null)
			{
				return false;
			}
			if (this.hasTagId != snsTag.hasTagId || (this.hasTagId && !this.tagId_.Equals(snsTag.tagId_)))
			{
				return false;
			}
			if (this.hasTagName != snsTag.hasTagName || (this.hasTagName && !this.tagName_.Equals(snsTag.tagName_)))
			{
				return false;
			}
			if (this.hasCount != snsTag.hasCount || (this.hasCount && !this.count_.Equals(snsTag.count_)))
			{
				return false;
			}
			if (this.list_.Count != snsTag.list_.Count)
			{
				return false;
			}
			for (int i = 0; i < this.list_.Count; i++)
			{
				if (!this.list_[i].Equals(snsTag.list_[i]))
				{
					return false;
				}
			}
			return true;
		}
		public override void PrintTo(TextWriter writer)
		{
			GeneratedMessageLite<SnsTag, SnsTag.Builder>.PrintField("TagId", this.hasTagId, this.tagId_, writer);
			GeneratedMessageLite<SnsTag, SnsTag.Builder>.PrintField("TagName", this.hasTagName, this.tagName_, writer);
			GeneratedMessageLite<SnsTag, SnsTag.Builder>.PrintField("Count", this.hasCount, this.count_, writer);
			GeneratedMessageLite<SnsTag, SnsTag.Builder>.PrintField<SKBuiltinString_t>("List", this.list_, writer);
		}
		public static SnsTag ParseFrom(byte[] data)
		{
			return SnsTag.CreateBuilder().MergeFrom(data).BuildParsed();
		}
		private SnsTag MakeReadOnly()
		{
			this.list_.MakeReadOnly();
			return this;
		}
		public static SnsTag.Builder CreateBuilder()
		{
			return new SnsTag.Builder();
		}
		public override SnsTag.Builder ToBuilder()
		{
			return SnsTag.CreateBuilder(this);
		}
		public override SnsTag.Builder CreateBuilderForType()
		{
			return new SnsTag.Builder();
		}
		public static SnsTag.Builder CreateBuilder(SnsTag prototype)
		{
			return new SnsTag.Builder(prototype);
		}
		static SnsTag()
		{
			SnsTag.defaultInstance = new SnsTag().MakeReadOnly();
			SnsTag._snsTagFieldNames = new string[]
			{
				"Count",
				"List",
				"TagId",
				"TagName"
			};
			SnsTag._snsTagFieldTags = new uint[]
			{
				24u,
				34u,
				8u,
				18u
			};
			object.ReferenceEquals(micromsg.Proto.SnsTag.Descriptor, null);
		}
	}
}
